 package bean.resource;

import dao.resource.ResourceDAO;
import entity.resource.Resource;

import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.inject.Inject;

@ManagedBean
@ViewScoped
public class ResourceListBean {
	
	@Inject
	private ResourceDAO resourceDAO;
	
	private List<Resource> listResources;
	
	public List<Resource> loadAllResources() {
		 return resourceDAO.findByCriteria();
	}
	
	public List<Resource> loadFreeResources(){
		return resourceDAO.findFreeResources();
	}

	public List<Resource> getListResources() {
		listResources = resourceDAO.findByCriteria();
		return listResources;
	}

	public void setListResources(List<Resource> listResources) {
		this.listResources = listResources;
	}

}